﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Libs.Content;

public partial class Controls_Right_Advice : System.Web.UI.UserControl
{
    public int CateID { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack) return;

        NewsWeb _NewsWeb = new NewsWeb();
        List<NewsWeb> lst = _NewsWeb.GetList(CateID, 0, 3);
        if (lst.Count > 0)
        {
            NewsWeb main = lst[0];

            imgMain.Src = AppUtils.ImageUrl(main.ImageUrl, "100", "77");
            hlMain.HRef = hlImgMain.HRef = main.Url;
            hlMain.InnerText = main.Title;
            if (lst.Count > 1)
            {
                lst.Remove(main);
                rptList.DataSource = lst;
                rptList.DataBind();
            }
        }
    }
}